//
//  CTMessageDetailWebViewController.m
//  ConstellationTalk_0.1
//
//  Created by riley on 15/6/11.
//  Copyright (c) 2015年 riley chu. All rights reserved.
//

#import "CTMessageDetailWebViewController.h"
#import "CTTabBarController.h"

//view
#import "CTMessageDetailWebView.h"

//function
#import "CTDebugManager.h"
#import "MobClick.h"

//model
#import "CTMessageItems.h"

@interface CTMessageDetailWebViewController ()<CTMessageDetailWebViewDelegate>
{
    CTMessageDetailWebView * messageDetailView;
}
@end

@implementation CTMessageDetailWebViewController
@synthesize item;


- (void)dealloc
{
    [messageDetailView removeFromSuperview];
    messageDetailView = nil;
    
    item = nil;
    
    [CTDebugManager showDebugLogInfo:@"dealloc : CTHomePageWebViewController Is Removed!!!"];
}
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    //统计
    [MobClick beginLogPageView:@"CTMessageDetailWebViewController"];
}
-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
    //统计
    [MobClick endLogPageView:@"CTMessageDetailWebViewController"];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    messageDetailView = [[CTMessageDetailWebView alloc] init];
    messageDetailView .delegate = self;
    messageDetailView .loadUrl = item.extras.key;
    [self.view addSubview:messageDetailView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

#pragma mark - delegate -
-(void)backAction:(CTMessageDetailWebView *)view
{
    [self.navigationController popViewControllerAnimated:YES];
    
    CTTabBarController * tabbarVC = (CTTabBarController *)self.navigationController.tabBarController;
    [tabbarVC showTabbarWithAnimate:YES];
}

@end
